#!/usr/bin/bash

# Copyright (c) 2023. Huawei Technologies Co.,Ltd.ALL rights reserved.
# This program is licensed under Mulan PSL v2.
# You can use it according to the terms and conditions of the Mulan PSL v2.
#          http://license.coscl.org.cn/MulanPSL2
# THIS PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
# See the Mulan PSL v2 for more detaitest -f.

# #############################################
# @Author    :   tanxin
# @Contact   :   njutanx@163.com
# @Date      :   2023/8/29
# @License   :   Mulan PSL v2
# @Desc      :   Test "dsconf" command
# #############################################

source "${OET_PATH}/libs/locallibs/common_lib.sh"

function pre_test() {
    LOG_INFO "Start to prepare the test environment."
    DNF_INSTALL "389-ds-base"
    echo "/usr/lib64/dirsrv" | tee /etc/ld.so.conf.d/custom-libraries.conf
    ldconfig
    export NSSLAPD_DB_LIB=bdb
    dscreate create-template 389_ds_test.inf
    dscreate from-file 389_ds_test.inf
    dsconf localhost backend create --suffix dc=example,dc=com --be-name example
    LOG_INFO "End to prepare the test environment."
}

function run_test() {
    LOG_INFO "Start to run test."
    dsconf localhost plugin automember show -h | grep "usage: dsconf.*instance.*plugin automember show"
    CHECK_RESULT $? 0 0 "Check: plugin automember show -h No Pass"
    dsconf localhost plugin automember enable -h | grep "usage: dsconf.*instance.*plugin automember enable"
    CHECK_RESULT $? 0 0 "Check: plugin automember enable -h No Pass"
    dsconf localhost plugin automember disable -h | grep "usage: dsconf.*instance.*plugin automember disable"
    CHECK_RESULT $? 0 0 "Check: plugin automember disable -h No Pass"
    dsconf localhost plugin automember status -h | grep "usage: dsconf.*instance.*plugin automember status"
    CHECK_RESULT $? 0 0 "Check: plugin automember status -h No Pass"
    dsconf localhost plugin automember list -h | grep "usage: dsconf.*instance.*plugin automember list"
    CHECK_RESULT $? 0 0 "Check: plugin automember list -h No Pass"
    dsconf localhost plugin automember list definitions -h | grep "usage: dsconf.*instance.*plugin automember list definitions"
    CHECK_RESULT $? 0 0 "Check: plugin automember list definitions -h No Pass"
    dsconf localhost plugin automember list regexes -h | grep "usage: dsconf.*instance.*plugin automember list regexes"
    CHECK_RESULT $? 0 0 "Check: plugin automember list regexes -h No Pass"
    dsconf localhost plugin automember definition -h | grep "usage: dsconf.*instance.*plugin automember definition"
    CHECK_RESULT $? 0 0 "Check: plugin automember definition -h No Pass"
    dsconf localhost plugin automember definition DEFNAME add -h | grep "usage: dsconf.*instance.*plugin automember definition DEFNAME add"
    CHECK_RESULT $? 0 0 "Check: plugin automember definition DEFNAME add -h No Pass"
    dsconf localhost plugin automember definition DEFNAME set -h | grep "usage: dsconf.*instance.*plugin automember definition DEFNAME set"
    CHECK_RESULT $? 0 0 "Check: plugin automember definition DEFNAME set -h No Pass"
    dsconf localhost plugin automember definition DEFNAME delete -h | grep "usage: dsconf.*instance.*plugin automember definition DEFNAME delete"
    CHECK_RESULT $? 0 0 "Check: plugin automember definition DEFNAME delete -h No Pass"
    dsconf localhost plugin automember definition DEFNAME show -h | grep "usage: dsconf.*instance.*plugin automember definition DEFNAME show"
    CHECK_RESULT $? 0 0 "Check: plugin automember definition DEFNAME show -h No Pass"
    dsconf localhost plugin automember definition DEFNAME regex -h | grep "usage: dsconf.*instance.*plugin automember definition DEFNAME regex"
    CHECK_RESULT $? 0 0 "Check: plugin automember definition DEFNAME regex -h No Pass"
    dsconf localhost plugin automember definition DEFNAME regex REGEXNAME add -h | grep "usage: dsconf.*instance.*plugin automember definition DEFNAME regex REGEXNAME add"
    CHECK_RESULT $? 0 0 "Check: plugin automember definition DEFNAME regex REGEXNAME add -h No Pass"
    dsconf localhost plugin automember definition DEFNAME regex REGEXNAME set -h | grep "usage: dsconf.*instance.*plugin automember definition DEFNAME regex REGEXNAME set"
    CHECK_RESULT $? 0 0 "Check: plugin automember definition DEFNAME regex REGEXNAME set -h No Pass"
    dsconf localhost plugin automember definition DEFNAME regex REGEXNAME delete -h | grep "usage: dsconf.*instance.*plugin automember definition DEFNAME regex REGEXNAME delete"
    CHECK_RESULT $? 0 0 "Check: plugin automember definition DEFNAME regex REGEXNAME delete -h No Pass"
    dsconf localhost plugin automember definition DEFNAME regex REGEXNAME show -h | grep "usage: dsconf.*instance.*plugin automember definition DEFNAME regex REGEXNAME show"
    CHECK_RESULT $? 0 0 "Check: plugin automember definition DEFNAME regex REGEXNAME show -h No Pass"
    dsconf localhost plugin automember fixup -h | grep "usage: dsconf.*instance.*plugin automember fixup"
    CHECK_RESULT $? 0 0 "Check: plugin automember fixup -h No Pass"
    dsconf localhost plugin referential-integrity -h | grep "usage: dsconf.*instance.*plugin referential-integrity"
    CHECK_RESULT $? 0 0 "Check: plugin referential-integrity -h No Pass"
    dsconf localhost plugin referential-integrity show -h | grep "usage: dsconf.*instance.*plugin referential-integrity show"
    CHECK_RESULT $? 0 0 "Check: plugin referential-integrity show -h No Pass"
    dsconf localhost plugin referential-integrity enable -h | grep "usage: dsconf.*instance.*plugin referential-integrity enable"
    CHECK_RESULT $? 0 0 "Check: plugin referential-integrity enable -h No Pass"
    dsconf localhost plugin referential-integrity disable -h | grep "usage: dsconf.*instance.*plugin referential-integrity disable"
    CHECK_RESULT $? 0 0 "Check: plugin referential-integrity disable -h No Pass"
    dsconf localhost plugin referential-integrity status -h | grep "usage: dsconf.*instance.*plugin referential-integrity status"
    CHECK_RESULT $? 0 0 "Check: plugin referential-integrity status -h No Pass"
    dsconf localhost plugin referential-integrity set -h | grep "usage: dsconf.*instance.*plugin referential-integrity set"
    CHECK_RESULT $? 0 0 "Check: plugin referential-integrity set -h No Pass"
    dsconf localhost plugin referential-integrity config-entry -h | grep "usage: dsconf.*instance.*plugin referential-integrity config-entry"
    CHECK_RESULT $? 0 0 "Check: plugin referential-integrity config-entry -h No Pass"
    dsconf localhost plugin referential-integrity config-entry add -h | grep "usage: dsconf.*instance.*plugin referential-integrity config-entry add"
    CHECK_RESULT $? 0 0 "Check: plugin referential-integrity config-entry add -h No Pass"
    dsconf localhost plugin referential-integrity config-entry set -h | grep "usage: dsconf.*instance.*plugin referential-integrity config-entry set"
    CHECK_RESULT $? 0 0 "Check: plugin referential-integrity config-entry set -h No Pass"
    dsconf localhost plugin referential-integrity config-entry show -h | grep "usage: dsconf.*instance.*plugin referential-integrity config-entry show"
    CHECK_RESULT $? 0 0 "Check: plugin referential-integrity config-entry show -h No Pass"
    dsconf localhost plugin root-dn -h | grep "usage: dsconf.*instance.*plugin root-dn"
    CHECK_RESULT $? 0 0 "Check: plugin root-dn -h No Pass"
    dsconf localhost plugin root-dn show -h | grep "usage: dsconf.*instance.*plugin root-dn show"
    CHECK_RESULT $? 0 0 "Check: plugin root-dn show -h No Pass"
    dsconf localhost plugin root-dn enable -h | grep "usage: dsconf.*instance.*plugin root-dn enable"
    CHECK_RESULT $? 0 0 "Check: plugin root-dn enable -h No Pass"
    dsconf localhost plugin root-dn disable -h | grep "usage: dsconf.*instance.*plugin root-dn disable"
    CHECK_RESULT $? 0 0 "Check: plugin root-dn disable -h No Pass"
    dsconf localhost plugin root-dn status -h | grep "usage: dsconf.*instance.*plugin root-dn status"
    CHECK_RESULT $? 0 0 "Check: plugin root-dn status -h No Pass"
    dsconf localhost plugin root-dn set -h | grep "usage: dsconf.*instance.*plugin root-dn set"
    CHECK_RESULT $? 0 0 "Check: plugin root-dn set -h No Pass"
    dsconf localhost plugin usn -h | grep "usage: dsconf.*instance.*plugin usn"
    CHECK_RESULT $? 0 0 "Check: plugin usn -h No Pass"
    dsconf localhost plugin usn show -h | grep "usage: dsconf.*instance.*plugin usn show"
    CHECK_RESULT $? 0 0 "Check: plugin usn show -h No Pass"
    dsconf localhost plugin usn enable -h | grep "usage: dsconf.*instance.*plugin usn enable"
    CHECK_RESULT $? 0 0 "Check: plugin usn enable -h No Pass"
    dsconf localhost plugin usn disable -h | grep "usage: dsconf.*instance.*plugin usn disable"
    CHECK_RESULT $? 0 0 "Check: plugin usn disable -h No Pass"
    dsconf localhost plugin usn status -h | grep "usage: dsconf.*instance.*plugin usn status"
    CHECK_RESULT $? 0 0 "Check: plugin usn status -h No Pass"
    dsconf localhost plugin usn global -h | grep "usage: dsconf.*instance.*plugin usn global"
    CHECK_RESULT $? 0 0 "Check: plugin usn global -h No Pass"
    dsconf localhost plugin usn cleanup -h | grep "usage: dsconf.*instance.*plugin usn cleanup"
    CHECK_RESULT $? 0 0 "Check: plugin usn cleanup -h No Pass"
    dsconf localhost plugin account-policy -h | grep "usage: dsconf.*instance.*plugin account-policy"
    CHECK_RESULT $? 0 0 "Check: plugin account-policy -h No Pass"
    dsconf localhost plugin account-policy show -h | grep "usage: dsconf.*instance.*plugin account-policy show"
    CHECK_RESULT $? 0 0 "Check: plugin account-policy show -h No Pass"
    dsconf localhost plugin account-policy enable -h | grep "usage: dsconf.*instance.*plugin account-policy enable"
    CHECK_RESULT $? 0 0 "Check: plugin account-policy enable -h No Pass"
    dsconf localhost plugin account-policy disable -h | grep "usage: dsconf.*instance.*plugin account-policy disable"
    CHECK_RESULT $? 0 0 "Check: plugin account-policy disable -h No Pass"
    dsconf localhost plugin account-policy status -h | grep "usage: dsconf.*instance.*plugin account-policy status"
    CHECK_RESULT $? 0 0 "Check: plugin account-policy status -h No Pass"
    dsconf localhost plugin account-policy set -h | grep "usage: dsconf.*instance.*plugin account-policy set"
    CHECK_RESULT $? 0 0 "Check: plugin account-policy set -h No Pass"
    dsconf localhost plugin account-policy config-entry -h | grep "usage: dsconf.*instance.*plugin account-policy config-entry"
    CHECK_RESULT $? 0 0 "Check: plugin account-policy  config-entry -h No Pass"
    dsconf localhost plugin account-policy config-entry add -h | grep "usage: dsconf.*instance.*plugin account-policy config-entry add"
    CHECK_RESULT $? 0 0 "Check: plugin account-policy config-entry add -h No Pass"
    dsconf localhost plugin account-policy config-entry set -h | grep "usage: dsconf.*instance.*plugin account-policy config-entry set"
    CHECK_RESULT $? 0 0 "Check: plugin account-policy config-entry set -h No Pass"
    dsconf localhost plugin account-policy config-entry show -h | grep "usage: dsconf.*instance.*plugin account-policy config-entry show"
    CHECK_RESULT $? 0 0 "Check: plugin account-policy config-entry show -h No Pass"
    dsconf localhost plugin account-policy config-entry delete -h | grep "usage: dsconf.*instance.*plugin account-policy config-entry delete"
    CHECK_RESULT $? 0 0 "Check: plugin account-policy config-entry delete -h No Pass"
    dsconf localhost plugin attr-uniq -h | grep "usage: dsconf.*instance.*plugin attr-uniq"
    CHECK_RESULT $? 0 0 "Check: plugin attr-uniq -h No Pass"
    dsconf localhost plugin attr-uniq list -h | grep "usage: dsconf.*instance.*plugin attr-uniq list"
    CHECK_RESULT $? 0 0 "Check: plugin attr-uniq list -h No Pass"
    dsconf localhost plugin attr-uniq add -h | grep "usage: dsconf.*instance.*plugin attr-uniq add"
    CHECK_RESULT $? 0 0 "Check: plugin attr-uniq add -h No Pass"
    dsconf localhost plugin attr-uniq set -h | grep "usage: dsconf.*instance.*plugin attr-uniq set"
    CHECK_RESULT $? 0 0 "Check: plugin attr-uniq set -h No Pass"
    dsconf localhost plugin attr-uniq show -h | grep "usage: dsconf.*instance.*plugin attr-uniq show"
    CHECK_RESULT $? 0 0 "Check: plugin attr-uniq show -h No Pass"
    dsconf localhost plugin attr-uniq delete -h | grep "usage: dsconf.*instance.*plugin attr-uniq delete"
    CHECK_RESULT $? 0 0 "Check: plugin attr-uniq delete -h No Pass"
    dsconf localhost plugin attr-uniq enable -h | grep "usage: dsconf.*instance.*plugin attr-uniq enable"
    CHECK_RESULT $? 0 0 "Check: plugin attr-uniq enable -h No Pass"
    dsconf localhost plugin attr-uniq disable -h | grep "usage: dsconf.*instance.*plugin attr-uniq disable"
    CHECK_RESULT $? 0 0 "Check: plugin attr-uniq disable -h No Pass"
    dsconf localhost plugin attr-uniq status -h | grep "usage: dsconf.*instance.*plugin attr-uniq status"
    CHECK_RESULT $? 0 0 "Check: plugin attr-uniq status -h No Pass"
    dsconf localhost plugin dna -h | grep "usage: dsconf.*instance.*plugin dna"
    CHECK_RESULT $? 0 0 "Check: plugin dna -h No Pass"
    dsconf localhost plugin dna show -h | grep "usage: dsconf.*instance.*plugin dna show"
    CHECK_RESULT $? 0 0 "Check: plugin dna show -h No Pass"
    dsconf localhost plugin dna enable -h | grep "usage: dsconf.*instance.*plugin dna enable"
    CHECK_RESULT $? 0 0 "Check: plugin dna enable -h No Pass"
    dsconf localhost plugin dna disable -h | grep "usage: dsconf.*instance.*plugin dna disable"
    CHECK_RESULT $? 0 0 "Check: plugin dna disable -h No Pass"
    dsconf localhost plugin dna status -h | grep "usage: dsconf.*instance.*plugin dna status"
    CHECK_RESULT $? 0 0 "Check: plugin dna status -h No Pass"
    dsconf localhost plugin dna list -h | grep "usage: dsconf.*instance.*plugin dna list"
    CHECK_RESULT $? 0 0 "Check: plugin dna list -h No Pass"
    dsconf localhost plugin dna list configs -h | grep "usage: dsconf.*instance.*plugin dna list configs"
    CHECK_RESULT $? 0 0 "Check: plugin dna list configs -h No Pass"
    dsconf localhost plugin dna list shared-configs -h | grep "usage: dsconf.*instance.*plugin dna list shared-configs"
    CHECK_RESULT $? 0 0 "Check: plugin dna list shared-configs -h No Pass"
    dsconf localhost plugin dna config -h | grep "usage: dsconf.*instance.*plugin dna config"
    CHECK_RESULT $? 0 0 "Check: plugin dna config -h No Pass"
    dsconf localhost plugin dna config NAME add -h | grep "usage: dsconf.*instance.*plugin dna config NAME add"
    CHECK_RESULT $? 0 0 "Check: plugin dna config NAME add -h No Pass"
    dsconf localhost plugin dna config NAME set -h | grep "usage: dsconf.*instance.*plugin dna config NAME set"
    CHECK_RESULT $? 0 0 "Check: plugin dna config NAME set -h No Pass"
    dsconf localhost plugin dna config NAME show -h | grep "usage: dsconf.*instance.*plugin dna config NAME show"
    CHECK_RESULT $? 0 0 "Check: plugin dna config NAME show -h No Pass"
    dsconf localhost plugin dna config NAME delete -h | grep "usage: dsconf.*instance.*plugin dna config NAME delete"
    CHECK_RESULT $? 0 0 "Check: plugin dna config NAME delete -h No Pass"
    dsconf localhost plugin dna config NAME shared-config-entry -h | grep "usage: dsconf.*instance.*plugin dna config NAME shared-config-entry"
    CHECK_RESULT $? 0 0 "Check: plugin dna config NAME shared-config-entry -h No Pass"
    dsconf localhost plugin dna config NAME shared-config-entry SHARED_CFG set  -h | grep "usage: dsconf.*instance.*plugin dna config NAME shared-config-entry"
    CHECK_RESULT $? 0 0 "Check: plugin dna config NAME shared-config-entry SHARED_CFG set  -h No Pass"
    dsconf localhost plugin dna config NAME shared-config-entry SHARED_CFG set  -h | grep "SHARED_CFG set"
    CHECK_RESULT $? 0 0 "Check: plugin dna config NAME shared-config-entry SHARED_CFG set  -h No Pass"
    dsconf localhost plugin dna config NAME shared-config-entry SHARED_CFG show -h | grep "usage: dsconf.*instance.*plugin dna config NAME shared-config-entry"
    CHECK_RESULT $? 0 0 "Check: plugin dna config NAME shared-config-entry SHARED_CFG show -h No Pass"
    dsconf localhost plugin dna config NAME shared-config-entry SHARED_CFG show -h | grep "SHARED_CFG show"
    CHECK_RESULT $? 0 0 "Check: plugin dna config NAME shared-config-entry SHARED_CFG show -h No Pass"
    dsconf localhost plugin dna config NAME shared-config-entry SHARED_CFG delete -h | grep "usage: dsconf.*instance.*plugin dna config NAME shared-config-entry"
    CHECK_RESULT $? 0 0 "Check: plugin dna config NAME shared-config-entry SHARED_CFG delete -h No Pass"
    dsconf localhost plugin dna config NAME shared-config-entry SHARED_CFG delete -h | grep "SHARED_CFG delete"
    CHECK_RESULT $? 0 0 "Check: plugin dna config NAME shared-config-entry SHARED_CFG delete -h No Pass"
    dsconf localhost plugin linked-attr -h | grep "usage: dsconf.*instance.*plugin linked-attr"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr -h No Pass"
    dsconf localhost plugin linked-attr show -h | grep "usage: dsconf.*instance.*plugin linked-attr show"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr show -h No Pass"
    dsconf localhost plugin linked-attr enable -h | grep "usage: dsconf.*instance.*plugin linked-attr enable"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr enable -h No Pass"
    dsconf localhost plugin linked-attr disable -h | grep "usage: dsconf.*instance.*plugin linked-attr disable"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr disable -h No Pass"
    dsconf localhost plugin linked-attr status -h | grep "usage: dsconf.*instance.*plugin linked-attr status"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr status -h No Pass"
    dsconf localhost plugin linked-attr fixup -h | grep "usage: dsconf.*instance.*plugin linked-attr fixup"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr fixup -h No Pass"
    dsconf localhost plugin linked-attr list -h | grep "usage: dsconf.*instance.*plugin linked-attr list"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr list -h No Pass"
    dsconf localhost plugin linked-attr config -h | grep "usage: dsconf.*instance.*plugin linked-attr config"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr config -h No Pass"
    dsconf localhost plugin linked-attr config NAME add -h | grep "usage: dsconf.*instance.*plugin linked-attr config NAME add"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr config NAME add -h No Pass"
    dsconf localhost plugin linked-attr config NAME set -h | grep "usage: dsconf.*instance.*plugin linked-attr config NAME set"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr config NAME set -h No Pass"
    dsconf localhost plugin linked-attr config NAME show -h | grep "usage: dsconf.*instance.*plugin linked-attr config NAME show"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr config NAME show -h No Pass"
    dsconf localhost plugin linked-attr config NAME delete -h | grep "usage: dsconf.*instance.*plugin linked-attr config NAME delete"
    CHECK_RESULT $? 0 0 "Check: plugin linked-attr config NAME delete -h No Pass"
    dsconf localhost plugin managed-entries show -h | grep "usage: dsconf.*instance.*plugin managed-entries show"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries show -h No Pass"
    dsconf localhost plugin managed-entries enable -h | grep "usage: dsconf.*instance.*plugin managed-entries enable"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries enable -h No Pass"
    dsconf localhost plugin managed-entries disable -h | grep "usage: dsconf.*instance.*plugin managed-entries disable"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries disable -h No Pass"
    dsconf localhost plugin managed-entries status -h | grep "usage: dsconf.*instance.*plugin managed-entries status"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries status -h No Pass"
    dsconf localhost plugin managed-entries set -h | grep "usage: dsconf.*instance.*plugin managed-entries set"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries set -h No Pass"
    dsconf localhost plugin managed-entries list -h | grep "usage: dsconf.*instance.*plugin managed-entries list"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries list -h No Pass"
    dsconf localhost plugin managed-entries list configs -h | grep "usage: dsconf.*instance.*plugin managed-entries list configs"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries list configs -h No Pass"
    dsconf localhost plugin managed-entries list templates -h | grep "usage: dsconf.*instance.*plugin managed-entries list templates"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries list templates -h No Pass"
    dsconf localhost plugin managed-entries config -h | grep "usage: dsconf.*instance.*plugin managed-entries config"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries config -h No Pass"
    dsconf localhost plugin managed-entries config NAME add -h | grep "usage: dsconf.*instance.*plugin managed-entries config NAME add"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries config NAME add -h No Pass"
    dsconf localhost plugin managed-entries config NAME set -h | grep "usage: dsconf.*instance.*plugin managed-entries config NAME set"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries config NAME set -h No Pass"
    dsconf localhost plugin managed-entries config NAME show -h | grep "usage: dsconf.*instance.*plugin managed-entries config NAME show"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries config NAME show -h No Pass"
    dsconf localhost plugin managed-entries config NAME delete -h | grep "usage: dsconf.*instance.*plugin managed-entries config NAME delete"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries config NAME delete -h No Pass"
    dsconf localhost plugin managed-entries template -h | grep "usage: dsconf.*instance.*plugin managed-entries template"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries template -h No Pass"
    dsconf localhost plugin managed-entries template DN add -h | grep "usage: dsconf.*instance.*plugin managed-entries template DN add"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries template DN add -h No Pass"
    dsconf localhost plugin managed-entries template DN set -h | grep "usage: dsconf.*instance.*plugin managed-entries template DN set"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries template DN set -h No Pass"
    dsconf localhost plugin managed-entries template DN show -h | grep "usage: dsconf.*instance.*plugin managed-entries template DN show"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries template DN show -h No Pass"
    dsconf localhost plugin managed-entries template DN delete -h | grep "usage: dsconf.*instance.*plugin managed-entries template DN delete"
    CHECK_RESULT $? 0 0 "Check: plugin managed-entries template DN delete -h No Pass" 
    LOG_INFO "End to run test."
}

function post_test() {
    LOG_INFO "Start to restore the test environment."
    echo "Yes I am sure" | dsconf localhost backend delete example
    dsctl localhost remove --do-it
    rm -rf 389_ds_test.inf /etc/ld.so.conf.d/custom-libraries.conf
    ldconfig
    DNF_REMOVE "$@"
    LOG_INFO "End to restore the test environment."
}

main "$@"